package class517;

public class TestList {
    public void addEmp(List<Emp>list,Emp emp) {
        list.add(emp);

    }

    public void findAllEmp(List<Emp>list) {
        for (int i = 0;i<list.size();i++){
            System.out.println(list.get(i));
        }

    }
    public Emp findEmpName(List<Emp>list,String ename){
        for (int i = 0;i<list.size();i++){
            if(ename.equals(list.get(i).getName)){
                return list.get(i);
            }
        }
        return null;
    }
    }
    public void updateEmpAge(List<Emp>list,Emp emp){
        for (int i = 0;i<list.size();i++){
            if(emp.getNumber().equals(list.get(i).getNumber())){
                list.set(i.emp);
                System.out.println(list);
            }
        }
    }

